<p>This rule raises an issue when a Component, Directive, or Pipe explicitly sets <code>standalone: false</code> in its decorator configuration.</p>
<h2>Why is this an issue?</h2>
<p>Angular’s standalone feature simplifies application architecture by eliminating the need for NgModules in many scenarios. Standalone components,
directives, and pipes can be used directly without being declared in an NgModule, making the codebase more modular and easier to maintain.</p>
<p>When you explicitly set <code>standalone: false</code>, you’re opting out of this modern approach and forcing the use of the older NgModule-based
architecture. This creates unnecessary complexity and goes against Angular’s current best practices.</p>
<p>Standalone architecture offers several benefits:</p>
<ul>
  <li> Reduced boilerplate code by eliminating NgModule declarations </li>
  <li> Better tree-shaking and smaller bundle sizes </li>
  <li> Simplified testing with fewer dependencies </li>
  <li> More intuitive component composition </li>
  <li> Easier migration path for future Angular versions </li>
</ul>
<h3>What is the potential impact?</h3>
<p>Using <code>standalone: false</code> unnecessarily increases application complexity and maintenance overhead. It forces developers to manage
NgModule declarations and imports, which can lead to circular dependencies and harder-to-debug issues. Additionally, it may result in larger bundle
sizes due to less effective tree-shaking.</p>
<h3>How to fix in Angular?</h3>
<p>Remove the <code>standalone: false</code> property to use the default standalone behavior, or explicitly set it to <code>true</code>.</p>
<h4>Non-compliant code example</h4>
<pre data-diff-id="1" data-diff-type="noncompliant">
@Component({
  standalone: false, // Noncompliant
  template: '&lt;div&gt;Hello&lt;/div&gt;'
})
class MyComponent {}
</pre>
<h4>Compliant code example</h4>
<pre data-diff-id="1" data-diff-type="compliant">
@Component({
  template: '&lt;div&gt;Hello&lt;/div&gt;'
})
class MyComponent {}

// Or explicitly set to true
@Component({
  standalone: true,
  template: '&lt;div&gt;Hello&lt;/div&gt;'
})
class MyComponent {}
</pre>
<p>For Directives, remove <code>standalone: false</code> to enable standalone architecture.</p>
<h4>Non-compliant code example</h4>
<pre data-diff-id="2" data-diff-type="noncompliant">
@Directive({
  selector: '[myDirective]',
  standalone: false // Noncompliant
})
class MyDirective {}
</pre>
<h4>Compliant code example</h4>
<pre data-diff-id="2" data-diff-type="compliant">
@Directive({
  selector: '[myDirective]'
})
class MyDirective {}
</pre>
<p>For Pipes, remove <code>standalone: false</code> to use standalone architecture.</p>
<h4>Non-compliant code example</h4>
<pre data-diff-id="3" data-diff-type="noncompliant">
@Pipe({
  name: 'myPipe',
  standalone: false // Noncompliant
})
class MyPipe {}
</pre>
<h4>Compliant code example</h4>
<pre data-diff-id="3" data-diff-type="compliant">
@Pipe({
  name: 'myPipe'
})
class MyPipe {}
</pre>
<h3>Documentation</h3>
<ul>
  <li> <a href="https://github.com/angular-eslint/angular-eslint">Angular ESLint</a> - Rule <a
  href="https://github.com/angular-eslint/angular-eslint/blob/main/packages/eslint-plugin/docs/rules/prefer-standalone.md">prefer-standalone</a> </li>
  <li> Angular Standalone Components Guide - <a href="https://angular.dev/guide/components/importing">Official Angular documentation on standalone
  components and their benefits</a> </li>
  <li> Angular Standalone APIs - <a href="https://angular.dev/guide/standalone-components">Comprehensive guide to Angular’s standalone APIs and
  migration strategies</a> </li>
</ul>
